<!DOCTYPE html>
<html>

<head>
    <title>我的消息</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="/js/bootstrap/css/bootstrap.min.css">
    <script src="/js/plugins/jquery/jquery.min.js"></script>
    <script src="/js/bootstrap/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="/css/font/css/font-awesome.min.css" />
    <link rel="stylesheet" href="/css/reset.css" />
    <link rel="stylesheet" href="/css/message.css" />
    <link rel="stylesheet" href="/css/strategyComment.css" />
    <script src="/js/plugins/jrender/jrender.js"></script>
    <link href="/css/zyd.comment.css" rel="stylesheet" type="text/css">
    <script src="/js/plugins/jquery-confirm/js/jquery-confirm.js"></script>
    <link rel="stylesheet" href="/js/plugins/dialog/dialog.css"/>
    <script src="/js/plugins/dialog/dialog.min.js"></script>
    <script src="/js/common.js"></script>
    <script>
        $(function () {
            var id = getUser().id;
            $.ajax({
                type: "POST",
                url:"/users/"+id+"/travelLikeIsRead",
                data:{"_method":"put"}
            });

            var msgs;
            var currentPage = 1;
            var pages;
            //获取点赞者内容信息
            $.get("/users/"+id+"/travelLikeIMes",function (data) {
                if(data){
                    msgs = data.list;
                    pages = data.pages;
                    renderVal(data);
                }
            });

            $(window).scroll(function () {
                if (isFull()) {
                    if (currentPage < pages) {
                        $.get("/users/"+id+"/travelLikeIMes", {currentPage: ++currentPage}, function (data) {
                            if(data){
                                $.merge(msgs, data.list);
                                renderVal({list:msgs});
                            }
                        })
                    } else {
                        $(document).dialog({
                            type: "notice",
                            infoText: "到底部了",
                            autoClose: 2500,
                            position: "bottom"  // center: 居中; bottom: 底部
                        });
                    }
                }

            })

            function renderVal(data) {
                $(".praiserMeList").renderValues(data,{
                    handle:function (ele, val) {
                        ele.href="/travelContent.html?id="+val;
                    }
                });
            }
        });
    </script>

    <style>
        .marginAll{
            margin-top: 10px;
            margin-left: 10px;
            margin-right: 10px;
        }


        .marginName{
            margin-left: 10px;
        }

        .div1{
            width: 400px;
            height: 26px;
            overflow: hidden;
        }

    </style>
</head>

<body>

<div class="search-head">
    <div class="row nav-search">
        <div class="col">
            <a href="javascript:history.go(-1);">
                <span><i class="fa fa-chevron-left" ></i></span>
            </a>
        </div>
        <div class="col">
            <span>点赞</span>
        </div>
        <div class="col"></div>
    </div>
</div>

<div class="click praiserMeList">
    <div render-loop="list">
        <div>
            <div class="row marginAll">
                <div class="col-2">
                    <a data-href="#">
                        <img class="rounded-circle" render-src="list.travelAuthor.headImgUrl" width="50px" height="50px">
                    </a>
                </div>
                <div class="col-10 ">
                    <div class="row">
                        <div class="div1">
                            <a target="_blank" class="marginName">
                                <strong render-html="list.travelAuthor.nickName"></strong>
                            </a>
                            <div class="timer" render-html="list.createTime">
                                <i class="fa fa-clock-o fa-fw"></i>
                            </div>
                        </div>
                        <div class="content">赞了你的游记:<a render-key="list.travel.id" render-fun="handle"
                             render-html="list.travel.title" style="color: blue"></a></div>
                    </div>
                </div>
            </div>
            <hr class="marginAll"/>
        </div>
    </div>

</div>


</body>
</html>